package com.pig4cloud.pigx.contract.open.api.vo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.pig4cloud.pigx.common.customize.utils.serializer.BigDecimalToPlainStringSerializer;
import com.pig4cloud.pigx.contract.annotation.SetScaleMainCurrency;
import com.pig4cloud.pigx.contract.annotation.SetScaleTokenCurrency;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 */
@Data
public class OpenApiPositionVOV1 implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 仓位id
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	/**
	 * 币对名称
	 */
	@ApiModelProperty(value = "币对名称")
	private String symbolName;

	/**
	 * 仓位模式（0逐仓、1全仓）
	 */
	@ApiModelProperty(value = "仓位模式（0逐仓、1全仓）")
	private String mode;

	/**
	 * 方向（0做多、1做空）
	 */
	@ApiModelProperty(value = "方向（0做多、1做空）")
	private String side;

	/**
	 * 倍数
	 */
	@ApiModelProperty(value = "倍数")
	private Integer multiple;

	/**
	 * 当前持仓量
	 */
	@ApiModelProperty(value = "当前持仓量")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleTokenCurrency()
	private BigDecimal nowNum;

	/**
	 * 当前持仓量(U本位)
	 */
	@ApiModelProperty(value = "当前持仓量(U本位)")
	@SetScaleMainCurrency()
	private BigDecimal uNowNum;

	/**
	 * 可用数量
	 */
	@ApiModelProperty(value = "可用数量")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleTokenCurrency
	private BigDecimal availableNum;

	/**
	 * 可用数量(U本位)
	 */
	@ApiModelProperty(value = "可用数量(U本位)")
	@SetScaleTokenCurrency
	private BigDecimal uAvailableNum;

	/**
	 * 平仓中冻结量
	 */
	@ApiModelProperty(value = "平仓中冻结量")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleTokenCurrency
	private BigDecimal closingNum;

	/**
	 * 平仓中冻结量(U本位)
	 */
	@ApiModelProperty(value = "平仓中冻结量(U本位)")
	@SetScaleTokenCurrency
	private BigDecimal uClosingNum;

	/**
	 * 开仓均价
	 */
	@ApiModelProperty(value = "开仓均价")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal openAvgPrice;

	/**
	 * 保证金
	 */
	@ApiModelProperty(value = "保证金")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal margin;

	/**
	 * 强平价
	 */
	@ApiModelProperty(value = "强平价")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal liquidatePrice;

	/**
	 * 未实现盈亏
	 */
	@ApiModelProperty(value = "未实现盈亏")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency
	private BigDecimal floatProfit;

	/**
	 * 保证金率
	 */
	@ApiModelProperty(value = "保证金率")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency(scale = 2)
	private BigDecimal marginRate;

	/**
	 * 持仓收益率
	 */
	@ApiModelProperty(value = "持仓收益率")
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	@SetScaleMainCurrency(scale = 2)
	private BigDecimal positionProfitRate;

	/**
	 * 初始保证金
	 */
	@JsonSerialize(using = BigDecimalToPlainStringSerializer.class)
	private BigDecimal initialMargin;

}
